import request from '@/utils/request'

// 查询股票列表增删改查列表
export function listStock(code) {
  const params = new URLSearchParams();
  if (code) {
    params.append('code', code);
  }
  return request({
    url: '/system/stock/sharePriceList?code='+params.toString(),
    method: 'get',
  })
}
// 买入股票
export function buyAdd(num, scokname, price, scokId) {
  return request({
    url :`/system/stock/buy/${num}/${scokname}/${price}/${scokId}`,
    method: 'get'
  })
}

// 买出股票
export function sellAdd(num, scokname, price, scokId) {
  return request({
    url :`/system/stock/sell/${num}/${scokname}/${price}/${scokId}`,
    method: 'get'
  })
}

